import wyd.domain.dto.User

import com.google.appengine.api.datastore.Entity
import com.google.appengine.api.datastore.EntityNotFoundException
import com.google.appengine.api.datastore.Key
import com.google.appengine.api.datastore.KeyFactory

println """
<html>
	<head>
		<title>Test</title>
	</head>
	<body>
	<pre>
"""
println '------------------------------------------------------------------------------'
println 'Testbed'
println '------------------------------------------------------------------------------'

Entity userE = null
Key key = KeyFactory.createKey(null, 'User', 'vteial')
try {
	datastore.get(key)
}
catch(EntityNotFoundException enfe) {

}
if(userE == null) {
	userE = new Entity(key)
	userE.password = 'pass'
	userE.name = 'Eialarasu'
	userE.emailId = 'vteial@wyd.com'
	userE.timeZone = 'timezone'
	def now = new Date()
	userE.createdTime = now
	userE.updatedTime = now
	userE.save()
	userE = datastore.get(userE.key)
}
println userE.key
println userE.toString()



println '------------------------------------------------------------------------------'
println """
</pre>
</body>
</html>
"""